const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    proxy: {
      "^/v1": {
        target: 'http://heima.9yuecloud.com:9988/api/private',
        chengeOrigin: true,
      }
    }
  },
  chainWebpack: (config) => {
    config.when(process.env.NODE_ENV === "production", (config) => {
      config.entry("app").clear().add("./src/main-prod.js");

      config.set("externals",{
        Vue:"vue",
        "vue-router":"VueRouter",
        Axios:"axios",
        lodash:"_",
        Echarts:"echarts",
        nprogress:"NProgress",
        // "vue-quill-editor":"VueQuillEditor"
      })

    });

    config.when(process.env.NODE_ENV === "development", (config) => {
      config.entry("app").clear().add("./src/main-dev.js");
    });
  },
})
